//
//  UIlabel+Exienion.m
//  weibo-OC
//
//  Created by diyuyma on 16/2/29.
//  Copyright © 2016年 zhangkaiyun. All rights reserved.
//

#import "UIlabel+Exienion.h"

@implementation UILabel (Exienion)

- (void)initWithLabel:(NSString *)title WithColor:(UIColor *)clolr WithSize:(CGFloat)size WithMargin:(CGFloat)margin {
    
    
    self.text = title;
    self.textAlignment = NSTextAlignmentCenter;
    self.font = [UIFont systemFontOfSize:size];
    self.textColor = clolr;
    if (margin != 0) {
        self.preferredMaxLayoutWidth = kScreenWidth - margin * 2;
        self.textAlignment = NSTextAlignmentLeft;
    }
    self.numberOfLines = 0;
    // 设置大小
    [self sizeToFit];
}

@end
